define(function(){
    var ec=require('echarts');
    require('echarts/chart/map');
    var zrUtil = require('zrender/tool/util');
    var zrnumber = require('echarts/util/number');

    var myChart=ec.init(document.getElementById('map'));

    var geoCoord={
        '阿坝':[102.4805,32.4536],
        '阿克苏':[82.9797,41.0229],
        '阿拉尔':[81.287026,40.552106],
        '阿拉善盟':[105.695683,38.843075],
        '阿勒泰':[88.2971,47.0929],
        '阿里':[82.3645,32.7667],
        '安徽':[117.2461,32.0361],
        '安康':[109.1162,32.7722],
        '安庆':[117.058739,30.537898],
        '安顺':[105.92827,26.228595],
        '安阳':[114.5325,36.0022],
        '鞍山':[123.0798,40.6055],
        '澳门':[113.5715,22.1583],
        '巴南区':[106.7322,29.4214],
        '巴彦淖尔市':[107.5562,41.3196],
        '巴音郭楞':[88.1653,39.6002],
        '巴中':[107.0618,31.9977],
        '白城':[123.0029,45.2637],
        '白沙':[109.445689,19.23112],
        '白山':[127.2217,42.0941],
        '白银':[104.8645,36.5076],
        '百色':[106.624775,23.908371],
        '蚌埠':[117.4109,33.1073],
        '包头':[110.3467,41.4899],
        '保定':[115.49481,38.886565],
        '保山':[99.177996,25.120489],
        '保亭':[109.697221,18.647938],
        '宝坻区':[117.4274,39.5913],
        '宝鸡':[107.1826,34.3433],
        '宝山区':[121.4346,31.4051],
        '北碚区':[106.5674,29.8883],
        '北辰区':[117.1761,39.2548],
        '北海':[109.314,21.6211],
        '北京':[116.4551,40.2539],
        '本溪':[124.1455,41.1987],
        '毕节':[105.290492,27.308589],
        '璧山':[106.2048,29.5807],
        '滨州':[117.968292,37.405314],
        '亳州':[116.1914,33.4698],
        '博尔塔拉':[82.072378,44.905979],
        '沧州':[116.863806,38.297615],
        '昌都':[97.185582,31.140576],
        '昌吉':[89.6814,44.4507],
        '昌江':[109.0407,19.2137],
        '昌平区':[116.1777,40.2134],
        '常德':[111.653718,29.012149],
        '常州':[119.980151,31.815856],
        '长春':[125.8154,44.2584],
        '长葛':[113.778489,34.220256],
        '长宁区':[121.3852,31.2115],
        '长沙':[113.0823,28.2568],
        '长寿区':[107.1606,29.9762],
        '长治':[113.120292,36.201664],
        '巢湖':[117.88049,31.608733],
        '潮州':[116.7847,23.8293],
        '郴州':[113.2361,25.8673],
        '城口':[108.7756,31.9098],
        '成都':[104.067923,30.679943],
        '承德':[117.933822,40.992521],
        '澄迈':[110.016202,19.742046],
        '池州':[117.494477,30.660019],
        '赤峰':[118.930761,42.297112],
        '崇明':[121.5637,31.5383],
        '崇文区':[116.4166,39.8811],
        '崇左':[107.380156,22.380782],
        '滁州':[118.32457,32.317351],
        '楚雄':[101.6016,25.3619],
        '达州':[107.6111,31.333],
        '大渡口区':[106.4905,29.4214],
        '大丰':[120.546274,33.190868],
        '大港区':[117.3875,38.757],
        '大理':[99.9536,25.6805],
        '大连':[122.2229,39.4409],
        '大庆':[125.02184,46.596709],
        '大同':[113.7854,39.8035],
        '大兴安岭':[124.317289,51.992308],
        '大兴区':[116.4716,39.6352],
        '大足':[105.7544,29.6136],
        '丹东':[124.541,40.4242],
        '儋州':[109.57447,19.521401],
        '德宏':[98.589434,24.44124],
        '德阳':[104.48,31.1133],
        '德州':[116.6858,37.2107],
        '迪庆':[99.713682,27.831029],
        '垫江':[107.4573,30.2454],
        '定安':[110.357171,19.68107],
        '定西':[104.626638,35.586056],
        '定州':[114.996919,38.522176],
        '东城区':[116.418,39.9367],
        '东方':[108.8498,19.0414],
        '东莞':[113.8953,22.901],
        '东丽区':[117.4013,39.1223],
        '东营':[118.7073,37.5513],
        '鄂尔多斯':[109.787827,39.614266],
        '鄂州':[114.900228,30.397737],
        '恩施':[109.5007,30.2563],
        '房山区':[115.8453,39.7163],
        '防城港':[108.351791,21.617398],
        '丰都':[107.8418,29.9048],
        '丰台区':[116.2683,39.8309],
        '奉节':[109.3909,30.9265],
        '奉贤区':[121.5747,30.8475],
        '佛山':[113.134026,23.035095],
        '涪陵区':[107.3364,29.6796],
        '福建':[118.3008,25.9277],
        '福州':[119.4543,25.9222],
        '抚顺':[124.585,41.8579],
        '抚州':[116.4441,27.4933],
        '莆田':[119.0918,25.3455],
        '阜新':[122.0032,42.2699],
        '阜阳':[115.820932,32.901211],
        '甘南':[102.9199,34.6893],
        '甘肃':[95.7129,40.166],
        '甘孜':[99.9207,31.0803],
        '赣州':[115.2795,25.8124],
        '菏泽':[115.6201,35.2057],
        '固原':[106.285268,36.021523],
        '馆陶':[115.300227,36.54843],
        '广安':[106.639712,30.461962],
        '广东':[113.4668,22.8076],
        '广西':[108.2813,23.6426],
        '广元':[105.850014,32.439212],
        '广州':[113.5107,23.2196],
        '桂林':[110.5554,25.318],
        '贵港':[109.9402,23.3459],
        '贵阳':[106.6992,26.7682],
        '贵州':[106.6113,26.9385],
        '果洛':[99.3823,34.0466],
        '哈尔滨':[127.9688,45.368],
        '哈密':[93.7793,42.9236],
        '海北':[100.907685,36.960539],
        '海淀区':[116.2202,40.0239],
        '海东':[102.3706,36.2988],
        '海口':[110.3893,19.8516],
        '海拉尔':[119.743282,49.218547],
        '海南':[100.625284,36.283118],
        '海南省':[109.9512,19.2041],
        '海西':[97.377407,37.350853],
        '邯郸':[114.482694,36.609308],
        '汉沽区':[117.8888,39.2191],
        '汉中':[107.045478,33.081569],
        '杭州':[120.219375,30.259244],
        '合川区':[106.3257,30.108],
        '合肥':[117.29,32.0581],
        '和平区':[117.2008,39.1189],
        '和田':[81.167,36.9855],
        '和县':[118.360177,31.747983],
        '河北':[115.4004,37.9688],
        '河北区':[117.2145,39.1615],
        '河池':[108.069948,24.699521],
        '河东区':[117.2571,39.1209],
        '河南':[113.4668,33.8818],
        '河西区':[117.2365,39.0804],
        '河源':[114.917,23.9722],
        '贺州':[111.552594,24.411054],
        '鹤壁':[114.3787,35.744],
        '鹤岗':[130.4407,47.7081],
        '黑河':[127.53496,50.251297],
        '黑龙江':[128.1445,48.5156],
        '衡水':[115.8838,37.7161],
        '衡阳':[112.583819,26.898164],
        '红河':[103.384065,23.367718],
        '红桥区':[117.1596,39.1663],
        '虹口区':[121.4882,31.2788],
        '呼和浩特':[111.660351,40.828319],
        '呼伦贝尔':[120.8057,50.2185],
        '湖北':[112.2363,31.1572],
        '湖南':[111.5332,27.3779],
        '湖州':[120.137243,30.877925],
        '葫芦岛':[120.843977,40.716869],
        '怀化':[109.986959,27.557483],
        '怀柔区':[116.6377,40.6219],
        '淮安':[119.030186,33.606513],
        '淮北':[116.791447,33.960023],
        '淮南':[117.018639,32.642812],
        '黄冈':[115.2686,30.6628],
        '黄南':[102.025169,35.525683],
        '黄浦区':[121.4868,31.219],
        '黄山':[118.321411,29.712904],
        '黄石':[115.050683,30.216127],
        '惠州':[114.6204,23.1647],
        '霍邱':[116.284609,32.359549],
        '鸡西':[132.7917,45.7361],
        '吉安':[114.992039,27.113848],
        '吉林':[126.8372,43.6047],
        '吉林省':[126.4746,43.5938],
        '济南':[117.1582,36.8701],
        '济宁':[116.8286,35.3375],
        '济源':[112.405268,35.105365],
        '蓟':[117.4672,40.004],
        '佳木斯':[133.0005,47.5763],
        '嘉定区':[121.2437,31.3625],
        '嘉兴':[120.9155,30.6354],
        '嘉峪关':[98.281635,39.802397],
        '江北区':[106.8311,29.6191],
        '江津区':[106.2158,28.9874],
        '江门':[113.078125,22.575117],
        '江苏':[120.0586,32.915],
        '江西':[116.0156,27.29],
        '焦作':[113.211836,35.234608],
        '揭阳':[116.379501,23.547999],
        '津南区':[117.3958,38.9603],
        '金昌':[102.208126,38.516072],
        '金华':[120.0037,29.1028],
        '金山区':[121.2657,30.8112],
        '锦州':[121.6626,41.4294],
        '晋城':[112.867333,35.499834],
        '晋中':[112.7747,37.37],
        '荆门':[112.6758,30.9979],
        '荆州':[113.291,30.0092],
        '景德镇':[117.334,29.3225],
        '静安区':[121.4484,31.2286],
        '静海':[116.9824,38.8312],
        '九江':[116.008451,29.711103],
        '九龙坡区':[106.3586,29.4049],
        '酒泉':[98.508415,39.741474],
        '喀什':[77.168,37.8534],
        '开':[108.4131,31.2561],
        '开封':[114.5764,34.6124],
        '克拉玛依':[85.2869,45.5054],
        '克孜勒苏':[76.135839,39.748238],
        '库尔勒':[86.181159,41.731954],
        '昆明':[102.9199,25.4663],
        '拉萨':[91.1865,30.1465],
        '来宾':[109.7095,23.8403],
        '莱芜':[117.684667,36.233654],
        '兰州':[103.823305,36.064226],
        '廊坊':[116.716106,39.528296],
        '乐东':[109.179793,18.752425],
        '乐清':[120.991885,28.118824],
        '乐山':[103.760824,29.600958],
        '漯河':[114.046061,33.576279],
        '丽江':[100.448,26.955],
        '丽水':[119.929576,28.4563],
        '连云港':[119.173872,34.601549],
        '凉山':[102.259591,27.892393],
        '梁平':[107.7429,30.6519],
        '聊城':[115.986869,36.455829],
        '辽宁':[122.3438,41.0889],
        '辽阳':[123.4094,41.1383],
        '辽源':[125.343,42.7643],
        '临沧':[99.613,24.0546],
        '临汾':[111.538788,36.099745],
        '临高':[109.696356,19.913613],
        '临夏':[103.2715,35.5737],
        '临猗':[110.786628,35.14855],
        '临沂':[118.340768,35.072409],
        '林芝':[95.4602,29.1138],
        '陵水':[110.026652,18.510882],
        '柳州':[109.422402,24.329053],
        '六安':[116.512193,31.751011],
        '六盘水':[104.852087,26.591866],
        '龙岩':[117.017997,25.078685],
        '陇南':[105.304,33.5632],
        '娄底':[111.996396,27.741073],
        '卢湾区':[121.4758,31.2074],
        '泸州':[105.4578,28.493],
        '洛阳':[112.447525,34.657368],
        '吕梁':[111.3574,37.7325],
        '马鞍山':[118.6304,31.5363],
        '茂名':[111.0059,22.0221],
        '梅州':[116.126403,24.304571],
        '眉山':[103.84143,30.061115],
        '门头沟区':[115.8,39.9957],
        '密云':[117.0923,40.5121],
        '绵阳':[104.7327,31.8713],
        '闵行区':[121.4992,31.0838],
        '明港':[114.062886,32.472391],
        '牡丹江':[129.7815,44.7089],
        '那曲':[92.067018,31.48068],
        '南岸区':[106.6663,29.5367],
        '南昌':[116.0046,28.6633],
        '南充':[106.2048,31.1517],
        '南川区':[107.1716,29.1302],
        '南汇区':[121.8755,30.954],
        '南京':[118.8062,31.9208],
        '南开区':[117.1527,39.1065],
        '南宁':[108.479,23.1152],
        '南平':[118.184208,26.647769],
        '南通':[121.1023,32.1625],
        '南阳':[112.535006,32.996696],
        '内江':[105.064933,29.586229],
        '内蒙古':[117.5977,44.3408],
        '宁波':[121.5967,29.6466],
        '宁德':[119.6521,26.9824],
        '宁河':[117.6801,39.3853],
        '宁夏':[105.9961,37.3096],
        '怒江':[99.1516,26.5594],
        '攀枝花':[101.72695,26.585051],
        '盘锦':[122.073228,41.141248],
        '彭水':[108.2043,29.3994],
        '平顶山':[113.199314,33.77219],
        '平谷区':[117.1706,40.2052],
        '平凉':[107.0728,35.321],
        '萍乡':[113.9282,27.4823],
        '濮阳':[115.1917,35.799],
        '普洱':[100.980058,22.788778],
        '普陀区':[121.3879,31.2602],
        '浦东新区':[121.6928,31.2561],
        '七台河':[131.2756,45.9558],
        '綦江':[106.6553,28.8171],
        '齐齐哈尔':[124.541,47.5818],
        '潜江':[112.904393,30.408658],
        '黔东南':[108.4241,26.4166],
        '黔江区':[108.7207,29.4708],
        '黔南':[107.523205,26.264536],
        '黔西南':[105.5347,25.3949],
        '钦州':[109.0283,22.0935],
        '秦皇岛':[119.604368,39.945462],
        '清徐':[112.365165,37.613217],
        '清远':[113.040773,23.698469],
        '青岛':[120.4651,36.3373],
        '青海':[96.2402,35.4199],
        '青浦区':[121.1751,31.1909],
        '庆阳':[107.644227,35.726801],
        '琼海':[110.478013,19.261083],
        '琼中':[109.84583,19.039041],
        '衢州':[118.875842,28.95691],
        '曲靖':[103.9417,25.7025],
        '泉州':[118.600362,24.901652],
        '日喀则':[88.887083,29.27287],
        '日照':[119.50718,35.420225],
        '荣昌':[105.5127,29.4708],
        '瑞安':[120.661512,27.783731],
        '三门峡':[111.20673,34.778424],
        '三明':[117.645178,26.269407],
        '三沙':[112.348842,16.85613],
        '三亚':[109.518409,18.258847],
        '沙坪坝区':[106.3696,29.6191],
        '厦门':[118.1689,24.6478],
        '山东':[118.7402,36.4307],
        '山南':[92.2083,28.3392],
        '山西':[112.4121,37.6611],
        '陕西':[109.5996,35.6396],
        '汕头':[117.1692,23.3405],
        '汕尾':[115.5762,23.0438],
        '商洛':[109.934208,33.873907],
        '商丘':[115.741,34.2828],
        '上海':[121.487899,31.249162],
        '上饶':[117.955464,28.457623],
        '韶关':[113.7964,24.7028],
        '绍兴':[120.592467,30.002365],
        '邵阳':[111.461525,27.236811],
        '深圳':[114.5435,22.5439],
        '神农架':[110.579402,31.341697],
        '沈阳':[123.432791,41.808645],
        '十堰':[110.804491,32.635397],
        '石河子':[86.086997,44.312119],
        '石家庄':[114.521193,38.048136],
        '石景山区':[116.1887,39.9346],
        '石柱土家族':[108.2813,30.1025],
        '石嘴山':[106.4795,39.0015],
        '沭阳':[118.808738,34.116604],
        '双桥区':[105.7874,29.4928],
        '双鸭山':[133.5938,46.7523],
        '顺德':[113.18703,22.84851],
        '顺义区':[116.7242,40.1619],
        '朔州':[113.0713,39.6991],
        '四川':[102.9199,30.1904],
        '四平':[124.541,43.4894],
        '松江区':[121.1984,31.0268],
        '松原':[124.832995,45.136049],
        '苏州':[120.6519,31.3989],
        '宿迁':[118.5535,33.7775],
        '宿州':[117.5208,33.6841],
        '绥化':[126.989095,46.646064],
        '遂宁':[105.599742,30.538581],
        '随州':[113.4338,31.8768],
        '塔城':[86.6272,45.8514],
        '台山':[112.800303,22.25788],
        '台湾':[121.0295,23.6082],
        '台州':[121.440613,28.668283],
        '太原':[112.550864,37.890277],
        '泰安':[117.089415,36.188078],
        '泰州':[120.0586,32.5525],
        '唐山':[118.4766,39.6826],
        '塘沽区':[117.6801,38.9987],
        '天津':[117.4219,39.4189],
        '天门':[113.172796,30.664472],
        '天水':[105.736932,34.584319],
        '铁岭':[124.2773,42.7423],
        '通化':[125.9583,41.8579],
        '通辽':[122.260363,43.633756],
        '通州区':[116.7297,39.8131],
        '桐城':[116.978977,31.04115],
        '潼南':[105.7764,30.1135],
        '铜川':[109.0393,35.1947],
        '铜梁':[106.0291,29.8059],
        '铜陵':[117.9382,30.9375],
        '铜仁':[109.196098,27.737515],
        '图木舒克':[79.1345,39.8749],
        '吐鲁番':[89.6375,42.4127],
        '屯昌':[110.11052,19.357222],
        '瓦房店':[121.986241,39.632532],
        '万盛区':[106.908,28.9325],
        '万宁':[110.391377,18.805356],
        '万州区':[108.3911,30.6958],
        '威海':[122.093958,37.528787],
        '潍坊':[119.142634,36.716115],
        '渭南':[109.7864,35.0299],
        '温州':[120.690635,28.002838],
        '文昌':[110.8905,19.7823],
        '文山':[104.8865,23.5712],
        '乌海':[106.886,39.4739],
        '乌兰察布':[113.112846,41.022363],
        '乌鲁木齐':[87.9236,43.5883],
        '巫山':[109.8853,31.1188],
        '巫溪':[109.3359,31.4813],
        '吴忠':[106.853,37.3755],
        '无锡':[120.3442,31.5527],
        '梧州':[111.305472,23.485395],
        '芜湖':[118.384108,31.36602],
        '五家渠':[87.550452,44.171053],
        '五指山':[109.5282,18.8299],
        '武汉':[114.3896,30.6628],
        '武隆':[107.655,29.35],
        '武清区':[117.0621,39.4121],
        '武威':[103.0188,38.1061],
        '武夷山':[118.035258,27.754912],
        '西安':[109.1162,34.2004],
        '西藏':[88.7695,31.6846],
        '西城区':[116.3631,39.9353],
        '西宁':[101.784728,36.623144],
        '西青区':[117.1829,39.0022],
        '西双版纳':[100.8984,21.8628],
        '锡林郭勒':[116.082893,43.951981],
        '仙桃':[113.461066,30.368175],
        '咸宁':[114.300061,29.880657],
        '咸阳':[108.707509,34.345373],
        '湘潭':[112.935556,27.835095],
        '湘西':[109.7864,28.6743],
        '襄阳':[112.129331,32.014578],
        '香港':[114.2784,22.3057],
        '孝感':[113.9502,31.1188],
        '忻州':[112.727939,38.461031],
        '新疆':[84.9023,41.748],
        '新乡':[114.2029,35.3595],
        '新余':[114.95,27.8174],
        '信阳':[114.8291,32.0197],
        '兴安盟':[122.048167,46.083757],
        '邢台':[114.8071,37.2821],
        '秀山':[109.0173,28.5205],
        '徐汇区':[121.4333,31.1607],
        '徐州':[117.5208,34.3268],
        '许昌':[113.835312,34.02674],
        '宣城':[118.8062,30.6244],
        '宣武区':[116.3603,39.8852],
        '雅安':[103.019506,29.986086],
        '烟台':[121.454395,37.46985],
        '鄢陵':[114.186678,34.106922],
        '延安':[109.50051,36.60332],
        '延边':[129.485902,42.896414],
        '延庆':[116.1543,40.5286],
        '盐城':[120.2234,33.5577],
        '扬州':[119.4653,32.8162],
        '杨浦区':[121.528,31.2966],
        '阳春':[111.798066,22.176017],
        '阳江':[111.97701,21.871517],
        '阳泉':[113.569238,37.869529],
        '伊春':[129.1992,47.9608],
        '伊犁':[82.5513,43.5498],
        '宜宾':[104.6558,28.548],
        '宜昌':[111.310981,30.732758],
        '宜春':[115.0159,28.3228],
        '益阳':[112.366547,28.588088],
        '银川':[106.3586,38.1775],
        '鹰潭':[117.0813,28.2349],
        '营口':[122.4316,40.4297],
        '永川区':[105.8643,29.2566],
        '永新':[114.248694,26.951217],
        '永州':[111.709,25.752],
        '酉阳':[108.8196,28.8666],
        '榆林':[109.8743,38.205],
        '渝北区':[106.7212,29.8499],
        '渝中区':[106.5344,29.5477],
        '禹州':[113.494167,34.146309],
        '玉林':[110.2148,22.3792],
        '玉树':[97.013316,33.00624],
        '玉溪':[102.545068,24.370447],
        '岳阳':[113.2361,29.1357],
        '云浮':[112.050946,22.937976],
        '云南':[101.8652,25.1807],
        '云阳':[108.8306,31.0089],
        '运城':[111.1487,35.2002],
        '枣庄':[117.323,34.8926],
        '闸北区':[121.4511,31.2794],
        '湛江':[110.365067,21.257463],
        '张北':[114.721248,41.149331],
        '张家界':[110.5115,29.328],
        '张家口':[115.1477,40.8527],
        '张掖':[99.7998,38.7433],
        '漳州':[117.676205,24.517065],
        '章丘':[117.479345,36.744883],
        '昭通':[104.0955,27.6031],
        '朝阳':[120.457235,41.579473],
        '朝阳区':[116.4977,39.949],
        '肇庆':[112.479653,23.078663],
        '赵县':[114.834938,37.769612],
        '浙江':[120.498,29.0918],
        '镇江':[119.4763,31.9702],
        '正定':[114.577675,38.150953],
        '郑州':[113.649644,34.75661],
        '中山':[113.4229,22.478],
        '中卫':[105.4028,36.9525],
        '忠':[107.8967,30.3223],
        '重庆':[107.7539,30.1904],
        '周口':[114.873,33.6951],
        '舟山':[122.2559,30.2234],
        '株洲':[113.5327,27.0319],
        '珠海':[113.7305,22.1155],
        '驻马店':[114.1589,32.9041],
        '庄河':[122.972664,39.686329],
        '淄博':[118.059134,36.804685],
        '资阳':[104.9744,30.1575],
        '自贡':[104.776071,29.359157],
        '遵义':[106.93126,27.699961],
        '义乌':[115.0159,28.3228]
    }

    var option = {
        backgroundColor: '#1b1b1b',
        color: [
            'rgba(255, 255, 255, 0.8)',
            'rgba(14, 241, 242, 0.8)',
            'rgba(37, 140, 249, 0.8)'
        ],
        title : {
            text: '事实数据',
            //subtext: '纯属虚构',
            x:'center',
            textStyle : {
                color: '#fff'
            }
        },
        legend: {
            orient: 'vertical',
            x:'left',
            data:['直营城市','渠道城市'],
            textStyle : {
                color: '#fff'
            }
        },
        series : [
            {
                name: '直营城市',
                type: 'map',
                mapType: 'china',
                hoverable: false,
                itemStyle:{
                    normal:{
                        borderColor:'rgba(100,149,237,1)',
                        borderWidth:1.5,
                        areaStyle:{
                            color: '#1b1b1b'
                        }
                    }
                },
                data : [],
                markPoint : {
                    symbolSize: 2,
                    large: true,
                    effect : {
                        //symbol : 'diamond',
                        symbolSize: 6,
                        show: true,
                        period: 2,
                        scaleSize : 5
                    },
                    data : []
                }
            },
            {
                name: '渠道城市',
                type: 'map',
                mapType: 'china',
                hoverable: false,
                data : [],
                markPoint : {
                    symbol : 'diamond',
                    symbolSize: 6,
                    large: true,
                    effect : {
                        show: true,
                        period: 2,
                        scaleSize : 5
                    },
                    data : []
                }
            }
        ]
    };

    function start(){

        //setDataTotal(false);
        myChart.setOption(option);
        setData(false);
       clearInterval(timeTicket);
       var timeTicket = setInterval(function(){setData(true)}, 2*1000);
        //clearInterval(timeTicket2);
        //var timeTicket2 = setInterval(function(){setDataTotal(true)}, 2*1000);

        function setData(isAsync){
            $.ajax({
                url: '/dashboard/realtime/cpc/map/getMapData',
                type: 'POST',
                async: isAsync,
                data:{},
                dataType: 'json',
                success:function(data){

                    var old=zrUtil.clone(myChart.component.legend.getSelectedMap());
                    option.title.text="截至目前  总点击量 ："+zrnumber.addCommas(data.click_pv)+"  总现金："+zrnumber.addCommas(data.click_cash);
                    if(isAsync)myChart.restore();
                    $.each(old,function(index,value){
                        myChart.component.legend.setSelected(index,value);
                    });

                    //$.each(option.series[0].markPoint.data,function(index,value){
                    //    myChart.delMarkPoint(0,value.name);
                    //});
                    //$.each(option.series[1].markPoint.data,function(index,value){
                    //    myChart.delMarkPoint(1,value.name);
                    //});
                    var re=[];
                    if(old['直营城市']==true){
                        $.each(data.city_direct,function(index,value){
                            if(value.city=='全国')return;
                            re.push({name:value.city,value:value.value,geoCoord:geoCoord[value.city]});
                            if(!geoCoord[value.city])console.log(value.city);
                        });
                    }
                    if(re&&re.length>0){
                        option.series[0].markPoint.data=re;
                    }
                    //myChart.addMarkPoint(0,option.series[0].markPoint);

                    var re2=[];
                    if(old['渠道城市']==true){
                        $.each(data.city_channel,function(index,value){
                            if(value.city=='全国')return;
                            re2.push({name:value.city,value:value.value,geoCoord:geoCoord[value.city]});
                            if(!geoCoord[value.city])console.log(value.city);
                        });
                    }
                    if(re2&&re2.length>0){
                        option.series[1].markPoint.data=re2;
                    }
                   // myChart.addMarkPoint(1,option.series[1].markPoint);


                     myChart.setOption(option,true);
                },
                timeout:5000
            });}

        function setDataTotal(isAsync){
            $.ajax({
                url: '/dashboard/realtime/cpc/map/getMapDataTotal',
                type: 'POST',
                async: isAsync,
                data:{},
                dataType: 'json',
                success:function(data){
                    option.title.text="截至目前  总点击量 ："+zrnumber.addCommas(data.click_pv)+"  总现金："+zrnumber.addCommas(data.click_cash);
                    myChart.setOption(option);
                },
                timeout:5000
            });}
    }


    return {'start':start};
});
